package k2_oop.p6_relation.demo02;


public class Cake {

    //关联关系，就是一个类直接作为另一个类的属性
    public Egg egg;
    public Milk milk;

    public Cake(Egg egg, Milk milk) {
        this.egg = egg;
        this.milk = milk;
    }

    public void makeCake(){
        System.out.println("使用"+egg.color+"的鸡蛋和"+milk.brand+"的牛奶做蛋糕");
    }



}
